<?php

define('WEB_SERVER_ROOT_PATH',  '/opt/php/sns/');
require(WEB_SERVER_ROOT_PATH. 'config/config.php');
#   $_REQUEST   =   array(
#       'do'        =>  'editUserInfo',
#       'time'      =>  time(),
#       'param'     =>  '{"uid":"周娅妘", "passwd":"21f6a9085682468035213adb67435cb9"}',
#       'signature' =>  'sign',
#   );
#   $_REQUEST   =   array(
#       'do'        =>  'userLogin',
#       'time'      =>  time(),
#       'hostUid'   =>  1,
#       'param'     =>  '{"account":"kisskillkiss", "passwd":"'. md5('a'). '"}',
#       'signature' =>  'sign',
#   );
$_REQUEST   =   array(
    'do'        =>  'emailLogin',
    'time'      =>  time(),
    'hostUid'   =>  1,
    'param'     =>  '{"email":"ann@ffrj.net", "passwd":"'. md5('a'). '"}',
    'signature' =>  'sign',
);
#   $_REQUEST   =   array(
#       'do'        =>  'getSquareLatestUserList',
#       'time'      =>  time(),
#       'hostUid'   =>  1,
#       'signature' =>  'sign',
#   );
#   $_REQUEST   =   array(
#       'do'        =>  'getBoardList',
#       'time'      =>  time(),
#       'hostUid'   =>  1,
#       'signature' =>  'sign',
#   );


$do         =   DOP::request('do');
$time       =   DOP::request('time');
$param      =   DOP::request('param');
$hostUid    =   DOP::request('hostUid');
$signature  =   DOP::request('signature');

if (empty($do) || empty($time) || empty($signature))
{
    $result =   'param is wrong! must need: do, time, signature';
    exit ($result);
}
define('HOST_UID', $hostUid);

$api    =   new SnsApi();
$result =   $api->callApi($do, $param, $time, $signature);
exit ($result);

